let list1:string[]=['a','b']
let list2:Array<string>=['a','b']
let list3:(string|number)[]=[1,2]
let list4:Array<string|number>=['a','b'] //泛型

interface Iobj{
    name:string,
    age:number,
    location?:string, //可选
    [propName:string]:any,//不关心、不知道、不想写
    getName?:(name:string)=>string
}
let obj:Iobj={
    name:'kk',
    age:10,
}


function test(a:string,b:string):string{
    return a.substring(1)+b.substring(0)
}
let result:string=test('aaaaaa','bbbb')


interface Ifunc{
    (a:string,b:string,c?:number):string
}
let myFunc:Ifunc=function (a:string,b:string,c?:number):string{
    return a.substring(1)+b.substring(0)
}



class Bus{
    private _list:any=[]     //不可
    public name:string='ee'  //大家可以
    protected age:number=18  //孩子可以访问 外面不可

}



interface Iclass{
    getName:()=>string
}
class A{
    name:string='xx'
    getName():string{
        return this.name
    }
}
function init(obj:Iclass){
    obj.getName()
}
let objA=new A()
init(objA)

class B implements Iclass{
    name:string='xx'
    getName():string{
        return this.name
    }
}
export default{}